package com.yootk.service.impl;

import com.yootk.common.dto.DeptDTO;
import com.yootk.service.IDeptMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;

@Service
public class DeptMessageServiceImpl implements IDeptMessageService {
    @Autowired
    private MessageChannel output; // 消息发送通道
    @Override
    public void sendMessage(DeptDTO dto) {
        this.output.send(MessageBuilder.withPayload(dto).build()); // 进行消息的发送
    }
}
